package com.computergames.server.dao;

import com.computergames.server.message.LoginRequestMessage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Repository;

@Repository
@Mapper
@Lazy
public interface UserDao{
    @Select("select * from user where username = #{username} and password = #{password}")
    LoginRequestMessage findUser(LoginRequestMessage user);

    @Select("select id from user where username = #{username}")
    int findUserId(String username);

    @Select("select password from user where username = #{username}")
    String findPasswordByUsername(String username);
}
